import type { VabRouteRecord } from '/#/router'
import Layout from '@vab/layouts/index.vue'


export const adminRouter: VabRouteRecord = {
    path: '/admin',
    name: 'admin',
    component: Layout,
    meta: {
      title: '管理员管理',
      icon: 'contacts-line',
      guard: {
        //2021年9月份新版本，当config/settings.js中rolesControl配置开启时，用于控制角色（全写）
        role: ["systemLogView", "adminUserView", "rolesView", "permissionView", "departmentView"],
        mode: "oneOf" //allOf: 数组内所有角色都拥有，返回True oneOf: 数组内拥有任一角色，返回True(等价第1种数据) except: 不拥有数组内任一角色，返回True(取反)
      }
    },
    children: [
      {
        path: 'adminUser',
        name: 'adminUser',
        component: () => import('@/views/admin/adminUser.vue'),
        meta: {
          title: '管理员列表',
          guard: {
            role: ["adminUserView"]
          },
        },
      },
      {
        path: 'adminRole',
        name: 'adminRole',
        component: () => import('@/views/admin/adminRole.vue'),
        meta: {
          title: '角色列表',
          guard: {
            role: ["rolesView"]
          },
        },
      },
      {
        path: 'adminPermission',
        name: 'adminPermission',
        component: () => import('@/views/admin/adminPermission.vue'),
        meta: {
          title: '权限列表',
          guard: {
            role: ["permissionView"]
          },
          
        },
      }
    ],
  }